<!doctype html>
<html>
    <head>
        <title>编写逻辑</title>
        <meta charset="utf-8" />
    </head>
    <body>
        <dl>
            <dt>如果是数组</dt>
            <dd>空数组 返回false</dd>
            <dd>数组头部值为"string" 返回剩余数组 以字符串形式连接</dd>
            <dd>其它情况数组以字符串形式连接</dd>
            <dt>如果是对象</dt>
            <dd>type为string 返回对象的value属性值</dd>
            <dd>type为self 返回自身</dd>
            <dt>其它情况返回false</dt>
        </dl>
        <script src="../match.js"></script>
        <script>
         var logicfn = match({
             "[]":false,
             "('string':xs)":xs=>xs.join(""),
             "x?array":x=>x.join(""),
             "{type:'string',value:val}":val=>val,
             "@obj{type:'self'}":obj=>obj,
             "else":false
         });
        </script>
    </body>
</html>
